// eslint-disable-next-line
import {
  UserLayout,
  BasicLayout,
  BlankLayout
} from '@/layouts'
import {
  bxAnaalyse
} from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}

export const asyncRouterMap = [{
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: {
      title: 'Home'
    },
    redirect: '/westernMedicine',
    children: [
      // {
      //   path: '/dashboard',
      //   name: 'dashboard',
      //   redirect: '/dashboard/analysis',
      //   component: RouteView,
      //   meta: {
      //     title: '统计管理',
      //     keepAlive: true,
      //     icon: 'pie-chart',
      //   },
      //   children: [{
      //     path: '/dashboard/analysis/:pageNo([1-9]\\d*)?',
      //     name: 'Analysis',
      //     component: () => import('@/views/dashboard/Analysis'),
      //     meta: {
      //       title: '统计',
      //       keepAlive: false,
      //     }
      //   }]
      // },


      {
        path: '/westernMedicine',
        name: 'westernMedicine',
        component: () => import('@/views/medicine/westernMedicine/index'),
        meta: {
          title: '西药管理',
          keepAlive: true,
          icon: 'profile',
        },
      },
      {
        path: '/chineseMedicine',
        name: 'chineseMedicine',
        component: () => import('@/views/medicine/chineseMedicine/index'),
        meta: {
          title: '中药管理',
          keepAlive: true,
          icon: 'profile',
        },
      },
      {
        path: '/orderList',
        name: 'orderList',
        redirect: '/order/zhongyao/list',
        component: RouteView,
        meta: {
          title: '订单管理',
          keepAlive: true,
          icon: 'ordered-list',
        },
        children: [{
            path: '/zhongyaoOrderList',
            name: 'zhongyaoOrderList',
            component: () => import('@/views/order/zhongyao/index'),
            meta: {
              title: '中药处方订单',
              keepAlive: true,
              icon: 'team',
            },
          },
          {
            path: '/zhongyaoOrderListDetail',
            name: 'zhongyaoOrderListDetail',
            component: () => import('@/views/order/zhongyao/detail'),
            hidden: true,
            meta: {
              title: '中药处方订单详情',
              keepAlive: true,
              icon: 'team',
            },
          },
          {
            path: '/xiyaoOrderList',
            name: 'xiyaoOrderList',
            component: () => import('@/views/order/xiyao/index'),
            meta: {
              title: '西药处方订单',
              keepAlive: true,
              icon: 'team',
            },
          },
          {
            path: '/xiyaoOrderListDetail',
            name: 'xiyaoOrderListDetail',
            component: () => import('@/views/order/xiyao/detail'),
            hidden: true,
            meta: {
              title: '西药处方订单详情',
              keepAlive: true,
              icon: 'team',
            },
          }
        ]
      },
      {
        path: '/shopInfo',
        name: 'shopInfo',
        component: () => import('@/views/pharmacy/detail'),
        meta: {
          title: '供应商设置',
          keepAlive: true,
          icon: 'profile',
        },
      },
      // {
      //   path: '/orderManage',
      //   name: 'orderManage',
      //   redirect: '/orderManage/OrderList',
      //   component: RouteView,
      //   meta: {
      //     title: '订单管理',
      //     keepAlive: true,
      //     icon: 'ordered-list',
      //   },
      //   children: [{
      //     path: '/orderManage/OrderList',
      //     name: 'OrderList',
      //     component: () => import('@/views/orderManage/OrderList'),
      //     meta: {
      //       title: '商品订单列表',
      //       keepAlive: false,
      //     }
      //   }]
      // },
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [{
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [{
        path: 'login',
        name: 'login',
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },

  {
    path: '/404',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]